import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'
import Login from '@/pages/Login'
import Layout from '@/pages/Layout'
import NotFound from '@/pages/NotFound'
import ProfileEdit from './pages/Profile/Edit/index'
export default function App() {
  return (
    <Router>
      <div className="app">
        {/* <ul>
          <li>
            <Link to="/login">登录</Link>
          </li>
          <li>
            <Link to="/home">布局</Link>
          </li>
        </ul> */}

        <Switch>
          <Redirect exact from="/" to="/home"></Redirect>
          {/* <Route
            exact
            path="/"
            render={() => <Redirect to="/home"></Redirect>}
          ></Route> */}
          <Route path="/login">
            <Login></Login>
          </Route>
          <Route path="/home">
            <Layout></Layout>
          </Route>
          <Route path="/profile/edit">
            <ProfileEdit></ProfileEdit>
          </Route>
          {/* 补充404页面 */}
          <Route>
            <NotFound></NotFound>
          </Route>
        </Switch>
      </div>
    </Router>
  )
}
